home *** CD-ROM | disk | FTP | other *** search
- #include "stdafx.h"
-
- cMachine::cMachine(int _x, int _y, cProperties *_orig)
- : cWeapon(_x, _y, _orig, "MOVING")
- {
- not_spitting = 2 * sec + rnd(4 * sec);
-
- ASSERT(!machine_contents_list.is_empty());
- ASSERT(orig->spot != 0);
- }
-
- cMachine::~cMachine()
- {
- }
-
- int cMachine::control()
- {
- cWeapon::control();
-
- // Spit?
-
- if (!not_spitting)
- {
- int rx = pmrnd(32), ry = rnd(32);
-
- cRolling *r = new cRolling (x + rx + orig->spot->x, y + ry - orig->spot->y, machine_contents_list.get_random());
- r->add_angular_speed(100, angle(rx, ry));
-
- new cEffect (x + rx, y + ry, orig, "SPIT");
-
- not_spitting = 2 * sec + rnd(4 * sec);
- }
-
- // Check if still on screen
-
- return !below_screen();
- }
-